package com.service;

import com.model.User;

import java.util.List;
import java.util.Map;

/**
 * Created by zhanghf on 2015/6/26.
 */
public interface UserManager {

    /**
     * 创建用户
     * @param user
     * @return 用户ID
     * @throws Exception
     */
    public long createUser(User user) throws Exception;

    /**
     * 通过用户名获取用户信息
     * @param id
     * @return 用户信息
     * @throws Exception
     */
    public User getUserById(long id) throws Exception;

    /**
     * 通过条件查询用户
     * @return 用户列表
     * @throws Exception
     */
    public List<User> getUser(Map<String,String> mapUser) throws Exception;

    /**
     * 通过用户登陆名查询用户信息
     * @param username
     * @return
     */
    public User getUserByName(String username);

    /**
     * 修改用户信息
     * @param user
     * @return true 成功 false 失败
     * @throws Exception
     */
    public boolean modifyUser(User user) throws Exception;

    /**
     * 删除用户
     * @param id
     * @return true 成功 false 失败
     * @throws Exception
     */
    public boolean delUser(long id) throws Exception;

    /**
     * 删除用户
     * @param id
     * @return true 成功 false 失败
     * @throws Exception
     */
    public boolean delUser(long[] id) throws Exception;

 }
